<?php
namespace App\Http\Controllers\Admin;

use App\Models\User;
use App\Support\ResourceCollection;

class UsersController extends Controller
{
    public function index()
    {
    	$orderBy = $this->getOrderByQuery([
    		'id',
    		'gender',
    		'created_at',
    	]);

        $result = User::orderByRaw($orderBy)
	        ->orderByDesc('id')
            ->paginate(per_page());
        return new ResourceCollection($result);
    }
}
